CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )

SET( PROJECT_NAME_TEMP DisholTest )

IF( DisholLib_SOURCE_DIR )
	
	PROJECT( ${PROJECT_NAME_TEMP} )

	INCLUDE( "${DisholLib_SOURCE_DIR}/FindDirectShow.cmake" )

	IF( MSVC )
		# Set Unicode as character set for Visual Studio projects. By default it's Multi-Byte
		ADD_DEFINITIONS(-DUNICODE -D_UNICODE)
			
		# Set Warning level to 4
		IF ( CMAKE_CXX_FLAGS MATCHES "/W[0-4]" )
			STRING( REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
		ELSE()
			SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4" )
		ENDIF()
	ENDIF()		
	
	INCLUDE_DIRECTORIES( ${DisholLib_SOURCE_DIR} ${DirectInput_INCLUDE_DIR} )
	
	SET	(	SOURCES
			Main.cpp
		)
	
	ADD_EXECUTABLE( ${PROJECT_NAME} ${SOURCES} )
	
	TARGET_LINK_LIBRARIES( ${PROJECT_NAME} DisholLib ${DirectShow_LIBRARIES} )
	
ELSE()
	
	MESSAGE("Can't find DisholLib. Project ${PROJECT_NAME_TEMP} won't be compiled")

ENDIF()

	
